package com.droidweb.snippets;

import java.util.ArrayList;

import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;



public class snippetsActivity extends ListActivity {
	
	ArrayList<String> stringList;
	listItemAdapter mListItemAdapter;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        // Page view defining list view and other page elements
        setContentView(R.layout.listView);
        
        stringList = new ArrayList<String>();
        stringList.add("String1");
        stringList.add("String2");
        stringList.add("String3");
        stringList.add("String4");
        
        setListAdapter(mListItemAdapter);
    }
    
    private class listItemAdapter extends ArrayAdapter<String>{
    	private ArrayList<String> items;
    	
    	public listItemAdapter(Context context, int textViewResourceId,
				ArrayList<String> items) {
			super(context, textViewResourceId, items);
			this.items = items;
		}
    	
    }
    
    public View getView(int position, View convertView, ViewGroup parent){
    	View v = convertView;
    	if(v == null){
    		LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(R.layout.listitemview, null);
    	}
    	/*
    	 * Set the items of the inflated view based on position in items
    	 */
    }
}